<?
/**************************************************************************************************
上传文件页面
Author			warmy
Create Date		2005-09-29

参数			form			设置存放上传文件名称表单的名称
				form			设置存放上传文件名称文本框名称
**************************************************************************************************/
$form = "";
$formname = "";
if(isset($_GET['formname']))
	$formname = $_GET['formname'];
if(isset($_GET['form']))
	$form = $_GET['form'];
$path = "";
if(isset($_GET["path"]) && $_GET["path"] != "")
	$path	= $_GET["path"];
$type	= 0;
if(isset($_GET['type']) && $_GET['type'] == "1")
	$type	= 1;
?>
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
td {  font-size: 9pt}
a {  color: #000000; text-decoration: none}
a:hover {  text-decoration: underline}
.tx {  height: 16px; width: 30px; border-color: black black #000000; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt; background-color: #eeeeee; color: #0000FF}
.bt {  font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; height: 16px; width: 80px; background-color: #eeeeee; cursor: hand}
.tx1 { height: 20px; width: 30px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #0000FF}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?if ($formname == "" || $form == "")
	print("未设置表单名称");
else
{
?>
<form name="form1" method="post" action="wnewssave.php?formname=<?=$formname?>&form=<?=$form?>" enctype="multipart/form-data"  onsubmit="return CheckForm()">
	<input type="hidden" name="filepath" class="tx" style="width:350" value="<?=$path?>">
	<input type="hidden" name="type" class="tx" style="width:350" value="<?=$type?>">
	<input type="file" name="<?=$formname?>" style="width:200" class="tx1" value=""> 
	<input type="submit" name="Submit" value="· 提交 ·" class="bt">   
	<input type=hidden name=proimg value="">
</form>
<script language="javascript">
function CheckForm()
{
	try
	{
		if(document.form1.<?=$formname?>.value=='')
		{
			alert('请选择需要上传的文件或图片！');
			return false;
		}
		return true;
	}
	catch(e)
	{
		alert(e.description);
	}
	return false;
}
function KillSpace(Str,list){
		if(typeof(list) == 'undefined')
			list = ' ';
			
		while((Str.length>0) && list.indexOf(Str.charAt(0))!=-1 )
			 Str = Str.substring(1,Str.length);
		while((Str.length>0) && list.indexOf(Str.charAt(Str.length-1))!=-1)
		     Str = Str.substring(0,Str.length-1);
		
        return Str;
}
</script>
<?}?>
</body>
</html>